package aml.parse;

import java.util.ArrayList;
import java.util.List;

import aml.runtime.Context;
import aml.runtime.Value;
import aml.runtime.ValueRef;

abstract public class ParseNode {
	protected List<ParseNode> children = new ArrayList<ParseNode>();
	
	public ParseNode addChild(ParseNode n) {
		children.add(n);
		return this;
	}
	
	public Value eval(Context ctx) {	// to override
		return null;
	}
	
	public ValueRef eref(Context ctx) {	// to override
		return null;
	}
	
	public int precedence() {
		return 1000000000;	// atoms do not have to override this method
	}
	
	public boolean isRightAssoc() {	// too common, so here
		return false;
	}
	
	public abstract String toString();
}